import React from 'react';
import { Route, Switch } from 'react-router-dom';
import Header from './header/Header';
import Roster from './roster/Roster';
import Schedule from './schedule/Schedule';

const Home = props => {
    return (
        <div>
            <h1>Welcome to my website</h1>
        </div>
    );
};

const Main = props => {
    return (
        <div>
            {/* exact 确保路由准确匹配到首页path */}
            <Switch>
                <Route exact path="/" component={ Home } />
                <Route path="/roster" component={ Roster } />
                <Route path="/schedule" component={ Schedule } />
            </Switch>
        </div>
    );
};

export default props => (
    <div>
        <Header />
        <Main />
    </div>
);